import Vue from "vue";
import VueRouter from "vue-router";
import ToDos from "../views/ToDos.vue";
import ShopCart from "../views/ShoppingCart.vue";
import TestMath from "../views/test-math.vue";

Vue.use(VueRouter);

const routes = [
  {
    path: "/",
    name: "index",
    component: ToDos,
  },
  {
    path: "/shoppingcart",
    name: "shoppingcart",
    component: ShopCart,
  },
  {
    path: "/testmath",
    name: "test-math",
    component: TestMath,
  },
  {
    path: "/list",
    name: "shopping-list",
    component: () => import( '../views/shopping-list.vue')
  },
  {
    path: "/food",
    name: "buy-food",
    component: () => import( '../views/buy-food.vue')
  },
  {
    path: "/dog",
    name: "buy -dog",
    component: () => import( '../views/buy-dog.vue')
  },
];

const router = new VueRouter({
  mode: "history",
  base: process.env.BASE_URL,
  routes,
});

export default router;
